package service;

import dao.Artist;
import dao.ArtistDao;
import dao.ArtistDaoImpl;

import java.util.List;

public class ArtistServiceImpl implements ArtistService {
    private static final ArtistService INSTANCE = new ArtistServiceImpl();
    private static final ArtistDao artistDao = ArtistDaoImpl.getInstance();

    private ArtistServiceImpl() {

    }

    public static ArtistService getInstance() {
        return INSTANCE;
    }

    @Override
    public List<Artist> getArtists() {
        List<Artist> artists = artistDao.getArtists();
        return artists;
    }

    @Override
    public Artist getArtistById(Long id) {
        Artist artist = artistDao.getArtistById(id);
        return artist;
    }

    @Override
    public Artist getArtistByAlbumId(Long albumId) {
        Artist artist = artistDao.getArtistByAlbumId(albumId);
        return artist;
    }
}
